package com.zhonghui.common.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.zhonghui.common.eshopDto.FromatDetailDto;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

@TableName("store_combination")
public class StoreCombination extends BaseDomain {
        @TableId
        @ApiModelProperty("拼团产品ID")
        private Long id;
        @ApiModelProperty("关联产品ID")
        private Long productId;
        @ApiModelProperty("商户id 预留字段")
        private Integer merId;
        @NotBlank(
                message = "请上传商品图片"
        )
        @ApiModelProperty("推荐图")
        private String image;
        @NotBlank(
                message = "请上传商品轮播"
        )
        @ApiModelProperty("轮播图")
        private String images;
        @NotBlank(
                message = "请填写拼团名称"
        )
        @ApiModelProperty("拼团产品名称")
        private String title;
        @NotNull(
                message = "请输入拼团人数"
        )
        @Min(
                message = "拼团人数小于0",
                value = 1L
        )
        @ApiModelProperty("拼团产品拼团人数")
        private Integer people;
        @ApiModelProperty("拼团产品简介")
        private String info;
        @NotNull(
                message = "请输入拼团价"
        )
        @DecimalMin(
                value = "0.00",
                message = "拼团价不在合法范围内"
        )
        @DecimalMax(
                value = "99999999.99",
                message = "拼团价不在合法范围内"
        )
        @ApiModelProperty("拼团产品拼团价")
        private BigDecimal price;
        private BigDecimal productPrice;
        @ApiModelProperty("排序")
        private Integer sort;
        @ApiModelProperty("销量")
        private Integer sales;
        @NotNull(
                message = "请输入库存"
        )
        @Min(
                message = "库存不能小于0",
                value = 1L
        )
        private Integer stock;
        @ApiModelProperty("是否推荐0不推荐1推荐")
        private Integer isHost;
        @ApiModelProperty("拼团产品状态0不显示 1显示")
        private Integer isShow;
        private Integer combination;
        @ApiModelProperty("商户是否可用1可用0不可用 预留字段")
        private Integer merUse;
        @NotBlank(
                message = "请填写详情"
        )
        @ApiModelProperty("拼团产品详情")
        private String description;
        @NotNull(
                message = "请选择结束时间"
        )
        @ApiModelProperty("拼团产品结束时间")
        private Date startTime;
        @NotNull(
                message = "请选择开始时间"
        )
        @ApiModelProperty("拼团产品开始时间")
        private Date stopTime;
        @NotNull(
                message = "请输入拼团时效"
        )
        @Min(
                message = "拼团时效不能小于0",
                value = 1L
        )
        @ApiModelProperty("拼团订单有效时间")
        private Integer effectiveTime;
        @ApiModelProperty("拼团产品成本价")
        private Integer cost;
        @ApiModelProperty("拼团产品浏览量")
        private Integer browse;
        @ApiModelProperty("拼团产品单位名")
        private String unitName;
        @ApiModelProperty("拼团产品规格 0单规格 1多规格")
        private Integer specType;
        @JsonProperty("temp_id")
        @ApiModelProperty("运费模板ID")
        private Long tempId;
        @TableField(
                exist = false
        )
        @ApiModelProperty("属性项目")
        private List<FromatDetailDto> items;
        @TableField(
                exist = false
        )
        private List<Map<String, Object>> attrs;

        public void copy(StoreCombination source) {
            BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
        }

    public StoreCombination() {
        }

        public Long getId() {
            return this.id;
        }

        public Long getProductId() {
            return this.productId;
        }

        public Integer getMerId() {
            return this.merId;
        }

        public String getImage() {
            return this.image;
        }

        public String getImages() {
            return this.images;
        }

        public String getTitle() {
            return this.title;
        }

        public Integer getPeople() {
            return this.people;
        }

        public String getInfo() {
            return this.info;
        }

        public BigDecimal getPrice() {
            return this.price;
        }

        public BigDecimal getProductPrice() {
            return this.productPrice;
        }

        public Integer getSort() {
            return this.sort;
        }

        public Integer getSales() {
            return this.sales;
        }

        public Integer getStock() {
            return this.stock;
        }

        public Integer getIsHost() {
            return this.isHost;
        }

        public Integer getIsShow() {
            return this.isShow;
        }

        public Integer getCombination() {
            return this.combination;
        }

        public Integer getMerUse() {
            return this.merUse;
        }

        public String getDescription() {
            return this.description;
        }

        public Date getStartTime() {
            return this.startTime;
        }

        public Date getStopTime() {
            return this.stopTime;
        }

        public Integer getEffectiveTime() {
            return this.effectiveTime;
        }

        public Integer getCost() {
            return this.cost;
        }

        public Integer getBrowse() {
            return this.browse;
        }

        public String getUnitName() {
            return this.unitName;
        }

        public Integer getSpecType() {
            return this.specType;
        }

        public Long getTempId() {
            return this.tempId;
        }

        public List<FromatDetailDto> getItems() {
            return this.items;
        }

        public List<Map<String, Object>> getAttrs() {
            return this.attrs;
        }

        public void setId(final Long id) {
            this.id = id;
        }

        public void setProductId(final Long productId) {
            this.productId = productId;
        }

        public void setMerId(final Integer merId) {
            this.merId = merId;
        }

        public void setImage(final String image) {
            this.image = image;
        }

        public void setImages(final String images) {
            this.images = images;
        }

        public void setTitle(final String title) {
            this.title = title;
        }

        public void setPeople(final Integer people) {
            this.people = people;
        }

        public void setInfo(final String info) {
            this.info = info;
        }

        public void setPrice(final BigDecimal price) {
            this.price = price;
        }

        public void setProductPrice(final BigDecimal productPrice) {
            this.productPrice = productPrice;
        }

        public void setSort(final Integer sort) {
            this.sort = sort;
        }

        public void setSales(final Integer sales) {
            this.sales = sales;
        }

        public void setStock(final Integer stock) {
            this.stock = stock;
        }

        public void setIsHost(final Integer isHost) {
            this.isHost = isHost;
        }

        public void setIsShow(final Integer isShow) {
            this.isShow = isShow;
        }

        public void setCombination(final Integer combination) {
            this.combination = combination;
        }

        public void setMerUse(final Integer merUse) {
            this.merUse = merUse;
        }

        public void setDescription(final String description) {
            this.description = description;
        }

        public void setStartTime(final Date startTime) {
            this.startTime = startTime;
        }

        public void setStopTime(final Date stopTime) {
            this.stopTime = stopTime;
        }

        public void setEffectiveTime(final Integer effectiveTime) {
            this.effectiveTime = effectiveTime;
        }

        public void setCost(final Integer cost) {
            this.cost = cost;
        }

        public void setBrowse(final Integer browse) {
            this.browse = browse;
        }

        public void setUnitName(final String unitName) {
            this.unitName = unitName;
        }

        public void setSpecType(final Integer specType) {
            this.specType = specType;
        }

        @JsonProperty("temp_id")
        public void setTempId(final Long tempId) {
            this.tempId = tempId;
        }

        public void setItems(final List<FromatDetailDto> items) {
            this.items = items;
        }

        public void setAttrs(final List<Map<String, Object>> attrs) {
            this.attrs = attrs;
        }

        public String toString() {
            return "StoreCombination(id=" + this.getId() + ", productId=" + this.getProductId() + ", merId=" + this.getMerId() + ", image=" + this.getImage() + ", images=" + this.getImages() + ", title=" + this.getTitle() + ", people=" + this.getPeople() + ", info=" + this.getInfo() + ", price=" + this.getPrice() + ", productPrice=" + this.getProductPrice() + ", sort=" + this.getSort() + ", sales=" + this.getSales() + ", stock=" + this.getStock() + ", isHost=" + this.getIsHost() + ", isShow=" + this.getIsShow() + ", combination=" + this.getCombination() + ", merUse=" + this.getMerUse() + ", description=" + this.getDescription() + ", startTime=" + this.getStartTime() + ", stopTime=" + this.getStopTime() + ", effectiveTime=" + this.getEffectiveTime() + ", cost=" + this.getCost() + ", browse=" + this.getBrowse() + ", unitName=" + this.getUnitName() + ", specType=" + this.getSpecType() + ", tempId=" + this.getTempId() + ", items=" + this.getItems() + ", attrs=" + this.getAttrs() + ")";
        }

        public boolean equals(final Object o) {
            if (o == this) {
                return true;
            } else if (!(o instanceof StoreCombination)) {
                return false;
            } else {
                StoreCombination other = (StoreCombination)o;
                if (!other.canEqual(this)) {
                    return false;
                } else if (!super.equals(o)) {
                    return false;
                } else {
                    label349: {
                        Object this$id = this.getId();
                        Object other$id = other.getId();
                        if (this$id == null) {
                            if (other$id == null) {
                                break label349;
                            }
                        } else if (this$id.equals(other$id)) {
                            break label349;
                        }

                        return false;
                    }

                    label342: {
                        Object this$productId = this.getProductId();
                        Object other$productId = other.getProductId();
                        if (this$productId == null) {
                            if (other$productId == null) {
                                break label342;
                            }
                        } else if (this$productId.equals(other$productId)) {
                            break label342;
                        }

                        return false;
                    }

                    Object this$merId = this.getMerId();
                    Object other$merId = other.getMerId();
                    if (this$merId == null) {
                        if (other$merId != null) {
                            return false;
                        }
                    } else if (!this$merId.equals(other$merId)) {
                        return false;
                    }

                    label328: {
                        Object this$people = this.getPeople();
                        Object other$people = other.getPeople();
                        if (this$people == null) {
                            if (other$people == null) {
                                break label328;
                            }
                        } else if (this$people.equals(other$people)) {
                            break label328;
                        }

                        return false;
                    }

                    Object this$sort = this.getSort();
                    Object other$sort = other.getSort();
                    if (this$sort == null) {
                        if (other$sort != null) {
                            return false;
                        }
                    } else if (!this$sort.equals(other$sort)) {
                        return false;
                    }

                    label314: {
                        Object this$sales = this.getSales();
                        Object other$sales = other.getSales();
                        if (this$sales == null) {
                            if (other$sales == null) {
                                break label314;
                            }
                        } else if (this$sales.equals(other$sales)) {
                            break label314;
                        }

                        return false;
                    }

                    Object this$stock = this.getStock();
                    Object other$stock = other.getStock();
                    if (this$stock == null) {
                        if (other$stock != null) {
                            return false;
                        }
                    } else if (!this$stock.equals(other$stock)) {
                        return false;
                    }

                    Object this$isHost = this.getIsHost();
                    Object other$isHost = other.getIsHost();
                    if (this$isHost == null) {
                        if (other$isHost != null) {
                            return false;
                        }
                    } else if (!this$isHost.equals(other$isHost)) {
                        return false;
                    }

                    Object this$isShow = this.getIsShow();
                    Object other$isShow = other.getIsShow();
                    if (this$isShow == null) {
                        if (other$isShow != null) {
                            return false;
                        }
                    } else if (!this$isShow.equals(other$isShow)) {
                        return false;
                    }

                    label286: {
                        Object this$combination = this.getCombination();
                        Object other$combination = other.getCombination();
                        if (this$combination == null) {
                            if (other$combination == null) {
                                break label286;
                            }
                        } else if (this$combination.equals(other$combination)) {
                            break label286;
                        }

                        return false;
                    }

                    label279: {
                        Object this$merUse = this.getMerUse();
                        Object other$merUse = other.getMerUse();
                        if (this$merUse == null) {
                            if (other$merUse == null) {
                                break label279;
                            }
                        } else if (this$merUse.equals(other$merUse)) {
                            break label279;
                        }

                        return false;
                    }

                    Object this$effectiveTime = this.getEffectiveTime();
                    Object other$effectiveTime = other.getEffectiveTime();
                    if (this$effectiveTime == null) {
                        if (other$effectiveTime != null) {
                            return false;
                        }
                    } else if (!this$effectiveTime.equals(other$effectiveTime)) {
                        return false;
                    }

                    label265: {
                        Object this$cost = this.getCost();
                        Object other$cost = other.getCost();
                        if (this$cost == null) {
                            if (other$cost == null) {
                                break label265;
                            }
                        } else if (this$cost.equals(other$cost)) {
                            break label265;
                        }

                        return false;
                    }

                    label258: {
                        Object this$browse = this.getBrowse();
                        Object other$browse = other.getBrowse();
                        if (this$browse == null) {
                            if (other$browse == null) {
                                break label258;
                            }
                        } else if (this$browse.equals(other$browse)) {
                            break label258;
                        }

                        return false;
                    }

                    Object this$specType = this.getSpecType();
                    Object other$specType = other.getSpecType();
                    if (this$specType == null) {
                        if (other$specType != null) {
                            return false;
                        }
                    } else if (!this$specType.equals(other$specType)) {
                        return false;
                    }

                    Object this$tempId = this.getTempId();
                    Object other$tempId = other.getTempId();
                    if (this$tempId == null) {
                        if (other$tempId != null) {
                            return false;
                        }
                    } else if (!this$tempId.equals(other$tempId)) {
                        return false;
                    }

                    label237: {
                        Object this$image = this.getImage();
                        Object other$image = other.getImage();
                        if (this$image == null) {
                            if (other$image == null) {
                                break label237;
                            }
                        } else if (this$image.equals(other$image)) {
                            break label237;
                        }

                        return false;
                    }

                    label230: {
                        Object this$images = this.getImages();
                        Object other$images = other.getImages();
                        if (this$images == null) {
                            if (other$images == null) {
                                break label230;
                            }
                        } else if (this$images.equals(other$images)) {
                            break label230;
                        }

                        return false;
                    }

                    Object this$title = this.getTitle();
                    Object other$title = other.getTitle();
                    if (this$title == null) {
                        if (other$title != null) {
                            return false;
                        }
                    } else if (!this$title.equals(other$title)) {
                        return false;
                    }

                    label216: {
                        Object this$info = this.getInfo();
                        Object other$info = other.getInfo();
                        if (this$info == null) {
                            if (other$info == null) {
                                break label216;
                            }
                        } else if (this$info.equals(other$info)) {
                            break label216;
                        }

                        return false;
                    }

                    Object this$price = this.getPrice();
                    Object other$price = other.getPrice();
                    if (this$price == null) {
                        if (other$price != null) {
                            return false;
                        }
                    } else if (!this$price.equals(other$price)) {
                        return false;
                    }

                    label202: {
                        Object this$productPrice = this.getProductPrice();
                        Object other$productPrice = other.getProductPrice();
                        if (this$productPrice == null) {
                            if (other$productPrice == null) {
                                break label202;
                            }
                        } else if (this$productPrice.equals(other$productPrice)) {
                            break label202;
                        }

                        return false;
                    }

                    Object this$description = this.getDescription();
                    Object other$description = other.getDescription();
                    if (this$description == null) {
                        if (other$description != null) {
                            return false;
                        }
                    } else if (!this$description.equals(other$description)) {
                        return false;
                    }

                    Object this$startTime = this.getStartTime();
                    Object other$startTime = other.getStartTime();
                    if (this$startTime == null) {
                        if (other$startTime != null) {
                            return false;
                        }
                    } else if (!this$startTime.equals(other$startTime)) {
                        return false;
                    }

                    Object this$stopTime = this.getStopTime();
                    Object other$stopTime = other.getStopTime();
                    if (this$stopTime == null) {
                        if (other$stopTime != null) {
                            return false;
                        }
                    } else if (!this$stopTime.equals(other$stopTime)) {
                        return false;
                    }

                    label174: {
                        Object this$unitName = this.getUnitName();
                        Object other$unitName = other.getUnitName();
                        if (this$unitName == null) {
                            if (other$unitName == null) {
                                break label174;
                            }
                        } else if (this$unitName.equals(other$unitName)) {
                            break label174;
                        }

                        return false;
                    }

                    label167: {
                        Object this$items = this.getItems();
                        Object other$items = other.getItems();
                        if (this$items == null) {
                            if (other$items == null) {
                                break label167;
                            }
                        } else if (this$items.equals(other$items)) {
                            break label167;
                        }

                        return false;
                    }

                    Object this$attrs = this.getAttrs();
                    Object other$attrs = other.getAttrs();
                    if (this$attrs == null) {
                        if (other$attrs != null) {
                            return false;
                        }
                    } else if (!this$attrs.equals(other$attrs)) {
                        return false;
                    }

                    return true;
                }
            }
        }

        protected boolean canEqual(final Object other) {
            return other instanceof StoreCombination;
        }

        public int hashCode() {
            boolean PRIME = true;
            int result = super.hashCode();
            Object $id = this.getId();
            result = result * 59 + ($id == null ? 43 : $id.hashCode());
            Object $productId = this.getProductId();
            result = result * 59 + ($productId == null ? 43 : $productId.hashCode());
            Object $merId = this.getMerId();
            result = result * 59 + ($merId == null ? 43 : $merId.hashCode());
            Object $people = this.getPeople();
            result = result * 59 + ($people == null ? 43 : $people.hashCode());
            Object $sort = this.getSort();
            result = result * 59 + ($sort == null ? 43 : $sort.hashCode());
            Object $sales = this.getSales();
            result = result * 59 + ($sales == null ? 43 : $sales.hashCode());
            Object $stock = this.getStock();
            result = result * 59 + ($stock == null ? 43 : $stock.hashCode());
            Object $isHost = this.getIsHost();
            result = result * 59 + ($isHost == null ? 43 : $isHost.hashCode());
            Object $isShow = this.getIsShow();
            result = result * 59 + ($isShow == null ? 43 : $isShow.hashCode());
            Object $combination = this.getCombination();
            result = result * 59 + ($combination == null ? 43 : $combination.hashCode());
            Object $merUse = this.getMerUse();
            result = result * 59 + ($merUse == null ? 43 : $merUse.hashCode());
            Object $effectiveTime = this.getEffectiveTime();
            result = result * 59 + ($effectiveTime == null ? 43 : $effectiveTime.hashCode());
            Object $cost = this.getCost();
            result = result * 59 + ($cost == null ? 43 : $cost.hashCode());
            Object $browse = this.getBrowse();
            result = result * 59 + ($browse == null ? 43 : $browse.hashCode());
            Object $specType = this.getSpecType();
            result = result * 59 + ($specType == null ? 43 : $specType.hashCode());
            Object $tempId = this.getTempId();
            result = result * 59 + ($tempId == null ? 43 : $tempId.hashCode());
            Object $image = this.getImage();
            result = result * 59 + ($image == null ? 43 : $image.hashCode());
            Object $images = this.getImages();
            result = result * 59 + ($images == null ? 43 : $images.hashCode());
            Object $title = this.getTitle();
            result = result * 59 + ($title == null ? 43 : $title.hashCode());
            Object $info = this.getInfo();
            result = result * 59 + ($info == null ? 43 : $info.hashCode());
            Object $price = this.getPrice();
            result = result * 59 + ($price == null ? 43 : $price.hashCode());
            Object $productPrice = this.getProductPrice();
            result = result * 59 + ($productPrice == null ? 43 : $productPrice.hashCode());
            Object $description = this.getDescription();
            result = result * 59 + ($description == null ? 43 : $description.hashCode());
            Object $startTime = this.getStartTime();
            result = result * 59 + ($startTime == null ? 43 : $startTime.hashCode());
            Object $stopTime = this.getStopTime();
            result = result * 59 + ($stopTime == null ? 43 : $stopTime.hashCode());
            Object $unitName = this.getUnitName();
            result = result * 59 + ($unitName == null ? 43 : $unitName.hashCode());
            Object $items = this.getItems();
            result = result * 59 + ($items == null ? 43 : $items.hashCode());
            Object $attrs = this.getAttrs();
            result = result * 59 + ($attrs == null ? 43 : $attrs.hashCode());
            return result;
        }
    }
